UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '08m/qLM7vVyQhUvb47EJolCPuYWkzkMzNitO3hb+eJ8=' 
WHERE 
  key_id = '67b6f9b8672d7ec58d09aaee99063a19f504b5a51347dd7f51a87324db4e08f4' 
  AND (
    token = '08m/qLM7vVyQhUvb47EJolCPuYWkzkMzNitO3hb+eJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029