UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iqCiDt7hLrOMjHWfNLyvA5pYPGU0/OZwdUCWYxxsa6M=' 
WHERE 
  key_id = '430e05b14425fe3a5dd300057e11781a3151f8d99f9cd3920e2b3e591425579c' 
  AND (
    token = 'iqCiDt7hLrOMjHWfNLyvA5pYPGU0/OZwdUCWYxxsa6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026