UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/cRM4WAVCSxLf0pQf6TBQmAU0q7pzUKexrq1PCv4QwM=' 
WHERE 
  key_id = 'd071871bff0e5376ac20d725a2ff68e6039b29a290f6423cc5733faa62fa32be' 
  AND (
    token = '/cRM4WAVCSxLf0pQf6TBQmAU0q7pzUKexrq1PCv4QwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030