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

Query time 0.00032