UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2EVI6EPxRSPKH1UF/1hoqpXuXC2S2alF6SvPYPv7rlM=' 
WHERE 
  key_id = '873cb0ce6afbbf1fe6ebe20f44087029012065fdb7d5def1165f31b771ceecad' 
  AND (
    token = '2EVI6EPxRSPKH1UF/1hoqpXuXC2S2alF6SvPYPv7rlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027