UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yGhFZLgEyN3K03txVpQ/eXKf5D4/HkcGoYtSpYWkwOo=' 
WHERE 
  key_id = 'ac98a8a09373bf8772db01d7afc016f80a7af1e79f63b9854f7b437d7c34da2a' 
  AND (
    token = 'yGhFZLgEyN3K03txVpQ/eXKf5D4/HkcGoYtSpYWkwOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025