UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hfOCrPxPV18hNj2M4GAnjKY/183n7t/rwDY9sFjdrOA=' 
WHERE 
  key_id = '9cfcaf5e9c1e815aad062e69ee5417eb42c6f22161851b2ccd51d08aa4cd6b38' 
  AND (
    token = 'hfOCrPxPV18hNj2M4GAnjKY/183n7t/rwDY9sFjdrOA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027