UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0OUu4uECb+NugZvOzcWzb0K6Q/JsE6ged/K6TIgOZx8=' 
WHERE 
  key_id = '56628ad09a9db4f4eed10b1afd574c59b1dd0176e02b68293b2148db5bd67ae8' 
  AND (
    token = '0OUu4uECb+NugZvOzcWzb0K6Q/JsE6ged/K6TIgOZx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053