UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZdvsmPWrsoAnq2CmdNc4v1Y+sqBHP09Tz71uPXR3wHM=' 
WHERE 
  key_id = '2313d5f0a321cea0b0a2078ab2fcfb52bc63bebf76d66c7e322b73ff444ac7ff' 
  AND (
    token = 'ZdvsmPWrsoAnq2CmdNc4v1Y+sqBHP09Tz71uPXR3wHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048