UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ptMRyYoiuqFHGa4yHOVQsnQ/0mRd9+jEFQLlnD7lf6s=' 
WHERE 
  key_id = '2b948d378a3c1ae1c31d781f4be57f196e9a0f672198150fe697a0b2fac73c61' 
  AND (
    token = 'ptMRyYoiuqFHGa4yHOVQsnQ/0mRd9+jEFQLlnD7lf6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041