UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3g4xFxF7J+/Me5hCm+acyaS8ldqXyykKCNHYKSEkKkY=' 
WHERE 
  key_id = '32149d3a6dceaa431b75255c567f717eef6cd84166ccb9fc46c76cda645a700d' 
  AND (
    token = '3g4xFxF7J+/Me5hCm+acyaS8ldqXyykKCNHYKSEkKkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029