UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S0rMGtvoyUMNRHNIJtcK9L7wRI05h9+dAk3Qgvcl8Eo=' 
WHERE 
  key_id = 'efd0f74ede26d4da64a671f0551e7e81f5152a68148cf8cb500ba96be3c30349' 
  AND (
    token = 'S0rMGtvoyUMNRHNIJtcK9L7wRI05h9+dAk3Qgvcl8Eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016