UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3zR3HNHz3waY6pIlnKptUWGdvJs12VTfwqUo1fmZWPM=' 
WHERE 
  key_id = '1363ed9104fe589fc01bfb4aaae2c9df5bfa053602db3a1fe180b2598c9ea2b4' 
  AND (
    token = '3zR3HNHz3waY6pIlnKptUWGdvJs12VTfwqUo1fmZWPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032