UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U9eWzm+PusActNAO7CiPWgHeXNLlEunuhPMOtQ4kU1k=' 
WHERE 
  key_id = '98ef79fbdcd5fd7189ef4ed5e3637bcee1d68d422f2d4b0f00c203a0fa8a9159' 
  AND (
    token = 'U9eWzm+PusActNAO7CiPWgHeXNLlEunuhPMOtQ4kU1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026