UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/WMTbPBM6C0j29S97tYEPHvpIH7wHCK2EJGxvthI/mM=' 
WHERE 
  key_id = '8db656c56b2bf180200927d327bfa849ea5a0aeb3b54e8c75264ad458d93af47' 
  AND (
    token = '/WMTbPBM6C0j29S97tYEPHvpIH7wHCK2EJGxvthI/mM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021