UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46IlS7hS3IpUmY6vT0IA2ML/t5KMiFvf/qlEOlNFbiA=' 
WHERE 
  key_id = '1e3aeffc8d4dd213309a1ca2ac6f9b8881322fd6c799e2cddd3da3f368ed82d7' 
  AND (
    token = '46IlS7hS3IpUmY6vT0IA2ML/t5KMiFvf/qlEOlNFbiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025