UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q+1D/l3ucxzqOoedD8Z2LTJNXCBzoPrXZIxJk30c7NI=' 
WHERE 
  key_id = 'a9e5dd95fc8e1f0dce679ebcb42f0fda21e77ac2c99398649e4e39f911921bb7' 
  AND (
    token = 'q+1D/l3ucxzqOoedD8Z2LTJNXCBzoPrXZIxJk30c7NI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025