UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mpALurfvy6wrghyuIX1FaLcqfyGig5H9jhlQyfmGCG4=' 
WHERE 
  key_id = '67f389a920ee5c7e6901ef57b183ed97d30e05a957be6460aa4a49de49ddafeb' 
  AND (
    token = 'mpALurfvy6wrghyuIX1FaLcqfyGig5H9jhlQyfmGCG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028