UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rqiuaG4A3aP4Y3qov+M4djw8a+zuUlb4NwRdEM7/f2o=' 
WHERE 
  key_id = 'a7028f56d083746a87c0d629cb15dabd0a6aada064f92e9554a742be8707f6ec' 
  AND (
    token = 'rqiuaG4A3aP4Y3qov+M4djw8a+zuUlb4NwRdEM7/f2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024