UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M/VpvLySZODijvv/Qjwdgt5EVAIMz8D4/UYM8bJ1bj4=' 
WHERE 
  key_id = 'eb01f1dabc32ffc26baea9285800bb6e4404859560ab6e6ef883ce89f1a5e6dc' 
  AND (
    token = 'M/VpvLySZODijvv/Qjwdgt5EVAIMz8D4/UYM8bJ1bj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026