UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TVaEkvxikW7/3SF/+z9OheYC9yFlziFHB7kaT90mc+M=' 
WHERE 
  key_id = '3503c8e2aa8d4e1cc8a5d5874986f2bed8adf63f25b826208819e9f063fe4235' 
  AND (
    token = 'TVaEkvxikW7/3SF/+z9OheYC9yFlziFHB7kaT90mc+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031