UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zGtoeJYZnF3Ft2lyWj9s7yKFfrPbuYrbMezOdMXoOOc=' 
WHERE 
  key_id = '8c0a68d78cac72b42ebb9a2d27dd5866c5031b2efd9cb5627ac6cd0e8a05324b' 
  AND (
    token = 'zGtoeJYZnF3Ft2lyWj9s7yKFfrPbuYrbMezOdMXoOOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030