UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oq/BfDn207s/TmlzfI7Gl3ta4vJ3GXmagBqyLUYV45w=' 
WHERE 
  key_id = '98d6f8a5a22c3a3d871a79298e7254ede78cbd37da62157a05f5342c20fc24f7' 
  AND (
    token = 'oq/BfDn207s/TmlzfI7Gl3ta4vJ3GXmagBqyLUYV45w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037