UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfwgJY2XhldIb3c4bbMgj8XIReyOU+aAGo+7VU/mK6M=' 
WHERE 
  key_id = '2f6db9ba132bc296d5471e3723f8eaf10e097df5a9c39cb0e73cf2413ccc7a47' 
  AND (
    token = 'MfwgJY2XhldIb3c4bbMgj8XIReyOU+aAGo+7VU/mK6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030