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

Query time 0.00020