UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uow/f9uoc4G9uyIMyFnTZOGTk/vKsTbz5SSVjNusl5w=' 
WHERE 
  key_id = 'f14960de4db474fc76c8081e119c8dd01f431b7ab1d14bd8270e470c1c93020d' 
  AND (
    token = 'Uow/f9uoc4G9uyIMyFnTZOGTk/vKsTbz5SSVjNusl5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054