UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PPI6HcRomSWoOA2JBaj3kpMpGK9wXNpAF5NjdvSzjjk=' 
WHERE 
  key_id = 'f5b38c08fb0c76e858e0d4cb908321c8176adafea12557022a3ab7fb1f321eca' 
  AND (
    token = 'PPI6HcRomSWoOA2JBaj3kpMpGK9wXNpAF5NjdvSzjjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022