UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'whYU6jl9My0PxYBOf+XQ9HIZAy2Lukjdet56fyOYXnE=' 
WHERE 
  key_id = '915cfaf4ccc089c80ae178145a2b24fbc887c91300199b6f044212f8cc2aa9b3' 
  AND (
    token = 'whYU6jl9My0PxYBOf+XQ9HIZAy2Lukjdet56fyOYXnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051