UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sbfRSRvy3Wd0NXh7inbKPVEp2dGcxmcsYl3Af6IKVf0=' 
WHERE 
  key_id = 'a807669f385870494a774d1361d49d01906d5faef178a620d2735c9cd18aa4fb' 
  AND (
    token = 'sbfRSRvy3Wd0NXh7inbKPVEp2dGcxmcsYl3Af6IKVf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056