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

Query time 0.00017